import config.Myconfig;
import config.Myconfig2;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import p1.User;
import p1.User2;

public class Mytest {
    public static void main(String[] args) {
        //如果完全使用了配置类方式去做,我们就只能通过 AnnotationConfig 上下文来获取容器,通过配置类的class对象来加载
        ApplicationContext context = new AnnotationConfigApplicationContext(Myconfig.class);
        User getuser =(User) context.getBean("getuser");
        System.out.println(getuser.getName());
    }
}
